<?php
require_once dirname(dirname(__FILE__)) . '/config/config.php';
require_once DOCUMENT_ROOT . DIR_SHARED_API . 'api_general.php';

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of api_security
 *
 * @author Thien
 */
class api_statistics {
    
    public static function get_access_number() {
        $access_number = 0;
        $dao_general = new dao_general();
        if (!$dao_general->check_option("access_number")) {
            $dao_general->set_option_value("access_number", "0");
        } else {
            $access_number = $dao_general->get_option_value("access_number");
        }
        return $access_number;
    }
    
    public static function increase_access_number() {
        $dao_general = new dao_general();
        if (!$dao_general->check_option("access_number")) {
            $dao_general->set_option_value("access_number", "1");
        } else {
            $access_number = $dao_general->get_option_value("access_number");
            $dao_general->set_option_value("access_number", $access_number + 1);
        }
    }
    
}
